//
//  DOConstants.h
//  DOFramework
//
//  Created by ju on 14-5-12.
//  Copyright (c) 2014年 dono. All rights reserved.
//

#import <Foundation/Foundation.h>

#if (! TARGET_OS_IPHONE)
#import <objc/objc-runtime.h>
#else
#import <objc/runtime.h>
#import <objc/message.h>
#endif

#define isCollectionType(x) (isNSSetType(x) || isNSArrayType(x) || isNSDictionaryType(x))

#define isNSArrayType(x) ([x isEqualToString:@"NSArray"] || [x isEqualToString:@"NSMutableArray"])
#define isNSDictionaryType(x) ([x isEqualToString:@"NSDictionary"] || [x isEqualToString:@"NSMutableDictionary"])
#define isNSSetType(x) ([x isEqualToString:@"NSSet"] || [x isEqualToString:@"NSMutableSet"])
#define isNSNumberType(x) ([x isEqualToString:@"NSNumber"])
#define isNSStringType(x) ([x isEqualToString:@"NSString"]) || ([x isEqualToString:@"NSMutableString"])

extern NSInteger const kDOParseTimeOut;
extern NSInteger const kDOParseCustomError;
extern NSInteger const kDOParseInvalidInstanceError;


extern NSInteger const kDOParseInsertError;
extern NSInteger const kDOParseDeleteError;
extern NSString *const kDOParseErrorDomain;

extern NSString *const kDOParsePropertiesTypeKey;
extern NSString *const kDOParseDatabaseTypeKey;
extern NSString *const kDOParsePropertiesSortedKey;


typedef void(^DOArrayResultBlock)(NSArray *objects , NSError *error);
typedef void(^DOBooleanResultBlock)(BOOL succeeded , NSError *error);
//typedef NSArray* (^DOExtractDataBody)(id jsonObject);
typedef void(^DOExtractDataBody)(id jsonObject,NSArray **outArray);
typedef BOOL(^UpgradeBlock)(void);
//facebook Parse bolck definative
/*
 typedef void (^PFBooleanResultBlock)(BOOL succeeded, NSError *error);
 typedef void (^PFIntegerResultBlock)(int number, NSError *error);
 typedef void (^PFArrayResultBlock)(NSArray *objects, NSError *error);
 typedef void (^PFObjectResultBlock)(PFObject *object, NSError *error);
 typedef void (^PFSetResultBlock)(NSSet *channels, NSError *error);
 typedef void (^PFUserResultBlock)(PFUser *user, NSError *error);
 typedef void (^PFDataResultBlock)(NSData *data, NSError *error);
 typedef void (^PFDataStreamResultBlock)(NSInputStream *stream, NSError *error);
 typedef void (^PFStringResultBlock)(NSString *string, NSError *error);
 typedef void (^PFIdResultBlock)(id object, NSError *error);
 typedef void (^PFProgressBlock)(int percentDone);
 */


@interface DOConstants : NSObject

@end
